﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>家长信息</title>
	<link rel="stylesheet" href="css/common2.css">
	<style>
		.school {
			margin-left: 2%;
			margin-top: 20px;
			display: inline-block;
		}

		.device_input {
			width: 170px;
			height: 36px;
			border-radius: 6px;
			border: solid 1px #1E9FFF;
			padding-left: 20px;
			background: none;
			font-size: 14px;
			color: #686868;
			display: inline-block;
			margin-left: 1%;
		}
		.summary-floating-box {
	position: fixed;
	bottom: 20px;
	left: 20px;
	background-color: rgba(30, 159, 255, 0.1);
	border: 1px solid #1E9FFF;
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 18px;
	color: #333;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	z-index: 999;
	font-weight: bold;
}

	</style>
</head>

<body class="main-body">
	<div id="vue-root" style="margin-top: 50px;">
	
		<div class="refresh" onclick="location.reload()">刷新</div>

		<form @submit.prevent="getData0">
		
			<input class="search" placeholder="请输入姓名" v-model="search.parentName"
				style="position: absolute; right: 255px; height: 33px; max-width: 118px;">
			<input class="search" placeholder="请输入订单号" v-model="search.orderId "
				style="position: absolute; right: 100px; height: 33px; max-width: 118px;">
			<!-- <input class="search" placeholder="请输入设备地点" v-model="search.name"
				style="position: absolute; right: 100px; height: 33px; max-width: 118px;"> -->
			<input type="submit" style="display: none;">
		</form>

		<img src="image/search.png" height="35" width="35" class="search_img" @click="getData0"
			style="position: absolute; right: 3%;">
		<br>

		<div class="table ">
			<table class="table_top">
				<thead>
					<tr>
						<th class="two">
							<input type="checkbox" class="check-box" v-model="all">
						</th>
						<th>序号</th>
						<th>订单号</th>
						<th>家长姓名</th>
						<th>学生姓名</th>
						<th>订单类型</th>
						<th>总价</th>
						<th>公司支付</th>
						<th>员工支付</th>
						 <th>订单生成日期</th>

						<th>备注信息</th>
						<!-- <th>查看订单详情</th>  -->
						<th>就读校区</th>
						<th>起止时间-结束时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody id="list">
					<tr v-for="(device,index) in list" :key="device.id">
						<td>
							<input type="checkbox" class="check-box" v-model="device.checked">
						</td>
						<td><span v-text="index+1"></span></td>
						<td v-text="device.orderNumber"></td>
						<td v-text="device.parentName"></td>
						<td v-text="device.studentName"></td>
						<td class="text" v-text="device.orderType"></td>
						<td v-text="device.totalPrice"></td>

						<td v-text="device.companyPayment"></td>
						<td v-text="device.employeePayment"></td>
						<td v-text="device.time"></td>
						<td v-text="device.remark"></td>
						<td v-text="device.schoolName"></td>
						<td >{{ device.startTime }} - {{ device.endTime }}</td>
						<td >
							<div>
								<div class="edit-icon option-icon">
									<a :href="'orderxcx_item.html?id='+device.id">
										<img class="img" height="20" width="20" src="../image/edit.png"
											onmouseover="this.src='../image/edit_light.png'"
											onmouseout="this.src='../image/edit.png'" />
									</a>
								</div>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="summary-floating-box">
			<div>总价合计：{{ summary.total_price_sum }}元</div>
			<div>公司支付合计：{{ summary.company_payment_sum }}元</div>
			<div>员工支付合计：{{ summary.employee_payment_sum }}元</div>
		</div>
		<form enctype="multipart/form-data" id="form" ref="form" style="display: none;">
			<input type="file" name="file" id="file" @change="importExcel" ref="file"
				accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel">
		</form>
		<div class="delete long-background-img" @click="exports">批量导出</div>
		<!-- <div class="delete" @click="batchDelete" v-if="total>1">批量删除</div>
		<div class="delete long-background-img" @click="exports">批量导出</div>
		<div class="delete long-background-img">
			<label for="file">批量导入</label>
		</div> -->

		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
			<li>
				<a v-text="pages"></a>
				<!--页面总数-->
			</li>
		</ul>
		<div style="float: right;margin-bottom: 20px;">
			总共{{total}}条记录
			<select class="ui-select init" style="height:32px" v-model="pageSize">
				<!--style="margin-top: 14px;"-->
				<option :value="10">每页10条</option>
				<option :value="30">每页30条</option>
				<option :value="100">每页100条</option>
			</select>
		</div>

	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="js/common.js"></script>
	<script src="js/list.js"></script>

	<script>

		var app = new Vue(merge({
			data: {
				agents: [],
				search: {
					type1: params().type1,
					active: params().active
				},
				urls: {
					list: '/api/orderXcx/list',
					del: '/pc/device/del',
					imports: '/pc/device/import',
				},
				summary: {
	total_price_sum: 0,
	company_payment_sum: 0,
	employee_payment_sum: 0
},

				query: location.search
			},
			created: function () {
				this.fetchTotalAmount();
				this.getData();
			},
			
			methods: {
				exports: function () {
					var q = Qs.stringify(this.search);
					if (q) q = '?' + q;
					location.href = '/api/orderXcx/export' + q;
				},
				fetchTotalAmount() {
					// 调用后台接口，获取汇总金额
					axios.get('/api/orderXcx/sums' ).then(function (res) {
					this.summary = res.data
				}.bind(this));

				},
			}
		}));
	</script>


</body>

</html>